package com.youkeyi.ddy.cloud.common.api.application.business.hr.employee.employee;

import com.youkeyi.ddy.cloud.common.api.application.business.hr.employee.employee.dto.BusinessEmployeeListCloudDto;
import com.youkeyi.ddy.cloud.common.api.application.business.hr.employee.employee.param.*;
import com.youkeyi.ddy.cloud.common.response.ResponseContent;
import io.swagger.annotations.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 员工
 *
 * @author  liuxiawang
 * @Date 5/24/22 10:36 PM
 * @Location shenzhen.china
 */
@Api(tags = {"【BUSINESS】Employee Management"})
@RestController
@FeignClient(value = "YOUKEYI-DDY-CLOUD-APPLICATION-BUSINESS", fallback = BusinessEmployeeCloudServiceFallback.class)
@RequestMapping("/business/employee")
public interface BusinessEmployeeCloudService {

    // 查询员工列表
    @ApiOperation(value = "Query Employee List", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.hr.employee.employee.BusinessEmployeeCloudService.list")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = BusinessEmployeeListCloudDto.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Query Employee List", dataType = "BusinessEmployeeListCloudParam", dataTypeClass = BusinessEmployeeListCloudParam.class),
    })
    @GetMapping
    public abstract BusinessEmployeeListCloudDto list(BusinessEmployeeListCloudParam param);

    // 创建员工
    @ApiOperation(value = "Create Employee", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.hr.employee.employee.BusinessEmployeeCloudService.create")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Create Employee", dataType = "BusinessEmployeeCreateCloudParam", dataTypeClass = BusinessEmployeeCreateCloudParam.class),
    })
    @PostMapping("/create")
    public abstract ResponseContent create(@RequestBody BusinessEmployeeCreateCloudParam param);


    // 编辑员工
    @ApiOperation(value = "Update Employee", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.hr.employee.employee.BusinessEmployeeCloudService.update")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Update Employee", dataType = "BusinessEmployeeUpdateCloudParam", dataTypeClass = BusinessEmployeeUpdateCloudParam.class),
    })
    @PatchMapping("update")
    public abstract ResponseContent update(@RequestBody BusinessEmployeeUpdateCloudParam param);


    // 删除员工
    @ApiOperation(value = "Delete Employee", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.hr.employee.employee.BusinessEmployeeCloudService.delete")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Delete Employee", dataType = "BusinessEmployeeDeleteCloudParam", dataTypeClass = BusinessEmployeeDeleteCloudParam.class),
    })
    @DeleteMapping("/delete")
    public abstract ResponseContent delete(BusinessEmployeeDeleteCloudParam param);





    // 员工确认到岗
    @ApiOperation(value = "Employee Duty Confirm", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.hr.employee.employee.BusinessEmployeeCloudService.dutyConfirm")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Employee Duty Confirm", dataType = "BusinessEmployeeDutyConfirmCloudParam", dataTypeClass = BusinessEmployeeDutyConfirmCloudParam.class),
    })
    @PatchMapping("/duty/confirm")
    public abstract ResponseContent dutyConfirm(@RequestBody BusinessEmployeeDutyConfirmCloudParam param);

}
